package com.aizuda.boot.modules.business.comment.entity.vo;


import com.aizuda.boot.modules.business.permission.domain.response.EmployeeShowVO;
import com.aizuda.boot.modules.file.domain.entity.FileInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@Schema(description = "评论响应信息")
public class CommentRespDTO {

    @Schema(description = "评论ID", example = "1")
    private Integer id;

    @Schema(description = "合同ID", example = "123456")
    private Integer contractId;

    @Schema(description = "用户ID", example = "10001")
    private Long userId;

    @Schema(description = "评论内容", example = "这是一条测试评论")
    private String commentText;

    @Schema(description = "父评论ID", example = "0")
    private Integer parentCommentId;

    @Schema(description = "评论类型：0-协商评论，1-审批评论", example = "0", allowableValues = "0,1")
    private Integer commentType;

    @Schema(description = "创建时间", example = "2023-10-01 12:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @Schema(description = "用户信息")
    private EmployeeShowVO userInfo;

    @Schema(description = "附件列表")
    private List<CommentAttachmentResp> attachments;

    @Schema(description = "子评论列表")
    private List<CommentRespDTO> childComments = new ArrayList<>();

    @Data
    @Schema(description = "评论附件响应")
    public static class CommentAttachmentResp {
        @Schema(description = "附件ID", example = "1")
        private Integer id;

        @Schema(description = "附件文件ID（关联文件表）", example = "123456789")
        private Long fileId;
        
        @Schema(description = "文件信息")
        private FileInfo fileInfo;
    }
}